package cn.krund.lyc.hotlerobot.activity.ui;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.krund.lyc.hotlerobot.R;
import cn.krund.lyc.hotlerobot.activity.base.BaseActivity;
import cn.krund.lyc.hotlerobot.utils.ToastUtils;
import cn.krund.lyc.hotlerobot.xunfei.XunfeiAlternate;

/**
 * @包名: cn.krund.lyc.hotlerobot.activity.ui
 * @作者: 刘育成
 * @时间: 2018/3/26  17:55
 * @org: 克路德人工智能
 * @描述: TODO  领路
 * @fileName: StartWayPatternActivity
 */

public class StartWayPatternActivity extends BaseActivity implements View.OnClickListener {
    @BindView(R.id.tv_back)
    TextView mTvBack;
    @BindView(R.id.tv_title)
    TextView mTvTitle;
    private XunfeiAlternate mXunfeiAlternate;
    @BindView(R.id.btn_start_way)
    Button mBtnStartWay;
    @BindView(R.id.ed_apartment)
    EditText mEdApartment;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_start_way_pattern;
    }

    @Override
    protected void initView() {
        mTvTitle.setText("引路");
        mXunfeiAlternate = XunfeiAlternate.getInstance();
    }

    @Override
    protected void initNev() {
        mTvBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mBtnStartWay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (TextUtils.isEmpty(mEdApartment.getText())) {
                    ToastUtils.showShortToast(StartWayPatternActivity.this, "请输入目的地");
                    return;
                }
                mXunfeiAlternate.speak("路线规划中，请稍等");
            }
        });
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_back:
                finish();
                break;
        }
    }
}
